<?php global $woo_options; ?>
<div id="slides">
	<div id="slide-box">
	<?php $slides = get_posts('post_type=slide&showposts='.$woo_options[ 'woo_slider_entries' ]); ?>
	<?php if (!empty($slides)) : ?>
		<div class="slides_container col-full">  
		<?php foreach($slides as $post) : setup_postdata($post); ?>
			
			<div class="slide">
			<?php $url = get_post_meta($post->ID, 'url', true); ?>
			<?php $slide_content_class = 'entry'; ?>
			<?php if ( get_post_meta($post->ID, 'embed', $single = true) ) { $slide_content_class = 'video'; } ?>
			
			
			<?php $type = get_post_meta($post->ID, "image", true) || get_post_meta($post->ID, "embed", true); if ( $type ) {	?>
			
				<div class="slide-content <?php echo $slide_content_class; ?> fl" <?php if ( !get_post_meta($post->ID, 'image', $single = true) && !get_post_meta($post->ID, 'embed', true) ) { echo 'style="width:auto;"'; } ?>>
				
					<?php if ($woo_options[ 'woo_slider_title' ] == "true" ) { ?><h2 class="title"><a href="<?php if ( $url ) { echo $url; } else { echo '#'; } ?>"><?php the_title(); ?></a></h2><?php } ?>
					
					<?php if ($woo_options[ 'woo_slider_content' ] == "true" ) { ?><?php the_content(); ?><?php } ?>
				
				</div><!-- /.slide-content -->
					
					<?php if ( get_post_meta($post->ID, 'image', $single = true) ) { ?>
					<div class="slide-image fl">
					<?php if ($url) { ?>
					<a href="<?php echo $url; ?>" title="<?php the_title(); ?>"><?php woo_image('key=image&width=960&height=338&class=slide-img&link=img'); ?></a>
						<?php } else { ?>
						<?php woo_image('key=image&width=960&height=338&class=slide-img&link=img'); } ?>
					</div><!-- /.slide-image -->
					
					<?php } elseif ( get_post_meta($post->ID, 'embed', $single = true) ) {
					
						echo woo_embed('key=embed&width=500&class=video'); } ?>
								
					<div class="fix"></div>
					
					<?php } else { ?><!-- // End $type IF Statement -->
	                
	                	<div class="entry">
		                    <?php the_content(); ?>
	                    </div>                        
	               
	                <?php } ?>
	                
			</div><!-- /.slide -->
			
		<?php endforeach; ?>
						
		</div><!-- /.slides_container -->
	<?php endif; ?>
	
		<a href="#" class="prev"><img src="<?php bloginfo('template_directory'); ?>/images/btn-prev-slider.png" alt="Arrow Prev" /></a>
		<a href="#" class="next"><img src="<?php bloginfo('template_directory'); ?>/images/btn-next-slider.png" alt="Arrow Next;" /></a>
	</div><!-- /#slide-box -->
</div><!-- /#slides -->
